import {createRouter, createWebHashHistory} from 'vue-router'

const routerHistory = createWebHashHistory();
const router = createRouter({
    history: routerHistory,
    routes: [
        {
            path: '/',
            meta: {
                title: '实例代码',
            },
            component: () => import('../view/course/index.vue')
        }
    ]
})
// 添加导航守卫
router.beforeEach((to, from, next) => {
    if (to.meta && to.meta.title) {
        document.title = to.meta.title;
    }
    next();
});
export default router
